# # 未完成，输出格式对
# from langchain_openai import OpenAI
# from pydantic import BaseModel, Field
# from langchain.output_parsers import CommaSeparatedListOutputParser
# from langchain.prompts import PromptTemplate
#
# model = OpenAI(
#     temperature=0,
#     openai_api_key="sk-rgymzddvnnrgwawnkevkdzlxkxfvhbviqgibbfgpvsyoqtur",
#     openai_api_base="https://api.siliconflow.cn/v1",
#     model="Qwen/Qwen3-8B"
# )
#
#
# class Joke(BaseModel):
#     setup: str = Field(description="")
#     punchline: str = Field(description="")
#
#
# parser = CommaSeparatedListOutputParser()
#
# prompt = PromptTemplate(
#     template="列出5个{subject}.\n{format_instructions}。\n"
#              "1直接输出结果，不要分析过程。\n"
#              "2输出内容也不要重复。\n"
#              "3不要做任何说明。\n"
#              "返回格式如下: 张伟，王芳，李娜，刘洋，陈明",
#     input_variables=["subject"],
#     partial_variables={"format_instructions": parser.get_format_instructions()})
#
# _input = prompt.format(subject="常见的中国名字")
# print(_input)
# output = model.invoke(_input)
# print(output)
#

from langchain.output_parsers import CommaSeparatedListOutputParser
parser = CommaSeparatedListOutputParser()

mock_data="张伟,王芳,李娜,刘洋,陈静"
result = parser.parse(mock_data)
print(result)
